package com.abner.test;

import java.util.Arrays;

/**
 * @author abner
 */
public class Exam4 {

    public static void main(String[] args) {

        int i = 1;
        String str = "hello";
        Integer num = 200;
        int[] arr = {1,2,3,4,5};
        MyData my = new MyData();

        change(i,str,num,arr,my);

        // 因为是基本类型改完没有告诉地址
        System.out.println("i= " + i);
        // 字符串拼接完会产生新的字符串
        System.out.println("str= " + str);
        // 包装类也是
        System.out.println("num= " + num);
        System.out.println("arr= " + Arrays.toString(arr));
        System.out.println("my.a= " + my.a);

    }

    public static void change(int j, String s, Integer n, int[] a, MyData m) {
        j += 1;
        s += "world";
        n += 1;
        a[0] += 1;
        m.a += 1;
    }
}

class MyData {
    int a = 10;
}
